package metalink.admin;

import java.util.ArrayList;

import vo.mixed.ProfessorListVo;
import model.admin.GetListsMo;
import model.admin.ModifyProfessorMo;

import com.opensymphony.xwork2.ActionSupport;

public class ModifyProfessorList extends ActionSupport {
	int staff_id;
	String staff_name;
	String project;
	String patent;
	String research;
	int course_id;
	String course_name;
	ArrayList<String> course_list;
	int professor_id;
	private String course_selected;

	public String getCourse_name() {
		return course_name;
	}

	public void setCourse_name(String course_name) {
		this.course_name = course_name;
	}

	public int getProfessor_id() {
		return professor_id;
	}

	public void setProfessor_id(int professor_id) {
		this.professor_id = professor_id;
	}

	public String getProject() {
		return project;
	}

	public void setProject(String project) {
		this.project = project;
	}

	public String getPatent() {
		return patent;
	}

	public void setPatent(String patent) {
		this.patent = patent;
	}

	public String getResearch() {
		return research;
	}

	public void setResearch(String research) {
		this.research = research;
	}

	public int getCourse_id() {
		return course_id;
	}

	public void setCourse_id(int course_id) {
		this.course_id = course_id;
	}

	public String getCourse_selected() {
		return course_selected;
	}

	public void setCourse_selected(String course_selected) {
		this.course_selected = course_selected;
	}

	public int getStaff_id() {
		return staff_id;
	}

	public void setStaff_id(int staff_id) {
		this.staff_id = staff_id;
	}

	public String getStaff_name() {
		return staff_name;
	}

	public void setStaff_name(String staff_name) {
		this.staff_name = staff_name;
	}

	public ArrayList<String> getCourse_list() {
		return course_list;
	}

	public void setCourse_list(ArrayList<String> course_list) {
		this.course_list = course_list;
	}

	public String execute() {
		GetListsMo li = new GetListsMo();
		setCourse_list(li.getCourseList(0, staff_id, 0));

		return SUCCESS;
	}

	public String updateBatchProfessorDetails() {
		ModifyProfessorMo prof_details = new ModifyProfessorMo();
		ProfessorListVo professor_details = new ProfessorListVo();
		professor_details.setStaff_id(staff_id);
		professor_details.setStaff_name(staff_name);
		professor_details.setPatent(patent);
		professor_details.setResearch(research);
		professor_details.setProject(project);
		professor_details.setCourse_name(course_selected);
		prof_details.updateProfessorDetails(professor_details);
		return SUCCESS;
	}

	public String addProfessorDetails() {
		GetListsMo list = new GetListsMo();
		setCourse_list(list.getCourseList(0, professor_id, 0));
		return SUCCESS;
	}

	public String submitNewBatchProfessor() {
		ModifyProfessorMo prof_details = new ModifyProfessorMo();
		ProfessorListVo professor_details = new ProfessorListVo();
		professor_details.setStaff_id(staff_id);
		professor_details.setStaff_name(staff_name);
		professor_details.setPatent(patent);
		professor_details.setResearch(research);
		professor_details.setProject(project);
		prof_details.updateProfessorDetails(professor_details);
		return SUCCESS;

	}

	public String editCourseProfessorDetails() {
		GetListsMo list = new GetListsMo();
		course_list = list.getAllCourses();
		return SUCCESS;
	}

	public String addNewProf() {
		ModifyProfessorMo prof_details = new ModifyProfessorMo();
		ProfessorListVo professor_details = new ProfessorListVo();
		professor_details.setStaff_id(staff_id);
		professor_details.setStaff_name(staff_name);
		professor_details.setPatent(patent);
		professor_details.setResearch(research);
		professor_details.setProject(project);
		professor_details.setCourse_name(course_selected);
		prof_details.addProfessorDetails(professor_details);
		return SUCCESS;
	}
}
